<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<title>订单</title>
		<meta http-equiv="expires" content="0">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<link rel="stylesheet" href="../../../css/reset.css" />
		<link rel="stylesheet" href="../../../css/mui.min.css" />
		<link rel="stylesheet" href="../../../css/iconfont.css" />
		<link rel="stylesheet" href="../../../css/cmms.css" />
		<link rel="stylesheet" href="../../../css/doctor/order.css" />
	</head>
	<body>
		<div class="mui-content" id="order" v-cloak>
			<div class="wrap">
			<section class="panel order-panel"  v-for="o in order">
				<div class="overflow order-title">
					<span>{{o.patientName}}</span>
					<span>{{o.payTime|replaceT}}</span>
					<span class="right"><i class="iconfont icon-shijian-"></i>{{o.orderState+''|formatState}}</span>
				</div>
				<div class="check-server-code" v-if="o.specimenBarCode&&o.specimenBarCode.length>0">
					检验条形码：{{o.specimenBarCode.join(',')}}</div>
				<div class="check-item" v-if="o.names&&o.names.length>0">{{o.names.join(',')}}</div>
				<div class="overflow check-item">
					<span>共<span class="basic-color">{{o.projectNum}}</span>个检验项目
					<span class="basic-color"> {{'￥'+o.amount}}</span></span>
					<span class="right"><i class="iconfont icon-icon1 basic-color"></i>{{o.doctorName}}</span>
				</div>
				<div class="overflow get-report">
					<span>{{o.reportTime}}个工作日</span>
					<span class="btn-detail right" @tap="orderDetail(o.orderId)">订单详情</span>
				</div>
			</section>
			<div class="noData" v-show="!order.length>0">
					<p><img src="../../../img/nodata.png"/></p>
					<p>暂无内容</p>
				</div>
			</div>
		</div>
		<script src="../../../js/mui.min.js"></script>
		<script src="../../../js/vue.js"></script>
		<script src="../../../js/cmms.js?time=333"></script>
		<script>
			new Vue({
				el:"#order",
				data:{
					order:[],
					id:''
				},
				mounted(){
					this.getUrl();
//					let id = location.href.split("?")[1].split('=')[1];
//					this.id = id;
					this.getOrderList();
				},
				methods:{
					getUrl(){
						let _this=this;
						var url = location.search; //获取url中"?"符后的字串    
						var theRequest = new Object();  
//						console.log(url);
					   	if (url.indexOf("?") != -1) {   
					      var str = url.substr(1);  
//					      console.log(str);
					      strs = str.split("&");  
					      for(var i = 0; i < strs.length; i ++) {   
					         theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);   
					      } 
					   	}   
					   	console.log(theRequest);
					   	_this.id = theRequest.id;
//					   	_this.specimenBarCode = theRequest.specimenBarCode;
					},
					getOrderList(){
						let _this = this;
						AT.muiAjaxDoctor('/clinic-doctor/order/getOrderByOrderPayId','post',{id:this.id},function(res){
//							console.log(res)
							_this.order = res;
						})
					},
					orderDetail(id){
						location.href = "../orderDetail.html?id="+id;
					}
				}
			})
		</script>
	</body>
</html>

